<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="functions.asp" -->
<%
   dim ucdeptquery
   dim tmpinvnum, tmpvendorid, tmprecdate, tmprecdate2, tmprptcond
   tmpinvnum = request("invnum")
   tmpvendorid = request("vendorid")
   tmprecdate = request("recdate")
   tmprecdate2 = request("recdate2")
   tmprptcond = request("rptcond")
   
   dim tmpOrder
   tmpOrder = "ASC"
   if (request.querystring("dOrder") <> "") then
   tmpOrder= request.querystring("dOrder")
   end if

   dim tmpSort
   tmpSort="REGNUM"
   if (request.querystring("dSort") <> "") then
   tmpSort= request.querystring("dSort")
   end if

   Dim CurrOrder
   if (tmpOrder = "ASC" )then 
   CurrOrder ="DESC"
   else
   CurrOrder="ASC"
   end if

Dim EXIREG__tmpCode
EXIREG__tmpCode = """"
if (empCode <> "") then EXIREG__tmpCode = empCode
Dim EXIREG__tmpMgr
EXIREG__tmpMgr = """"
if (mgrCode <> "") then EXIREG__tmpMgr = mgrCode
%>
<%'AND LOCATION <>'FINANCE'
set EXIREG = Server.CreateObject("ADODB.Recordset")
EXIREG.ActiveConnection = cn
if (isUC="Y") then
	ucdeptquery = "(SELECT DEPARTMENT AS UCDEPT FROM EXIUSERCOORD WHERE LOWER(UCNAME)='" & lcase(usrname) & "')"
	EXIREG.Source = "SELECT SEQNUM, REGNUM, LOCATION, PONUM, DEPARTMENT, USERDEPT,INVNUM, VENDORID, INVSTATUS, INVAMOUNT, CURRENCYSYMBOL, INVRECDATE, "_
& "INVDUEDATE, (SELECT LOCNAME=CASE WHEN LASTNAME IS NOT NULL THEN EMP.FIRSTNAME + ' '  + EMP.LASTNAME WHEN LASTNAME IS NULL THEN EMP.FIRSTNAME END FROM dbo.EMP WHERE EMP.EMPCODE=EXIREG.LOCATION) AS LOCNAME, "_
& "(SELECT TOP 1  VENDOR.NAME FROM VENDOR WHERE VENDOR.VENDORID=EXIREG.VENDORID) AS VENDORNAME, "_
& "ISOPEN, SERVICERCP, UPDATESTAMP,REFERENCEDOC  FROM dbo.EXIREG  "_
& "WHERE ( INVSTATUS = 'ROUTED'  OR INVSTATUS='PREAPPROVED' OR INVSTATUS = 'APPROVED W/O RECEIPT' OR INVSTATUS = 'REJECTED' ) "_
& " AND (USERCOORD='" & empCode & "'  OR LOCATION='" & empcode & "'  OR LOCATION='" & mgrCode & "'  OR USERDEPT='" & Dept & "' OR USERDEPT IN " & ucdeptquery & ") AND LOCATION <> '' ORDER BY " & tmpSort & " " & tmpOrder 

else
	EXIREG.Source = "SELECT SEQNUM, REGNUM, LOCATION, PONUM, USERDEPT, INVNUM, VENDORID, INVSTATUS, INVAMOUNT, CURRENCYSYMBOL, "_
& "INVRECDATE, INVDUEDATE, (SELECT LOCNAME=CASE WHEN LASTNAME IS NOT NULL THEN EMP.FIRSTNAME + ' '  + EMP.LASTNAME WHEN LASTNAME IS NULL THEN EMP.FIRSTNAME END FROM dbo.EMP WHERE EMP.EMPCODE=EXIREG.LOCATION) AS LOCNAME,  "_
& "(SELECT TOP 1  VENDOR.NAME FROM VENDOR WHERE VENDOR.VENDORID=EXIREG.VENDORID) AS VENDORNAME, ISOPEN, SERVICERCP, "_
& "UPDATESTAMP,REFERENCEDOC  FROM dbo.EXIREG  WHERE ( INVSTATUS = 'ROUTED'  OR INVSTATUS='PREAPPROVED' OR INVSTATUS = 'REJECTED'  OR INVSTATUS='APPROVED W/O RECEIPT') AND (LOCATION='" + Replace(EXIREG__tmpCode, "'", "''") + "' OR LOCATION='" + Replace(EXIREG__tmpMgr, "'", "''") + "')  ORDER BY UPDATESTAMP"

end if
'EXIREG.CursorType = 0
'EXIREG.CursorLocation = 2
'EXIREG.LockType = 3
EXIREG.Open()
EXIREG_numRows = 0
%>
<%
Dim LVO__tmpCode
LVO__tmpCode = "''"
if (empCode <> "") then LVO__tmpCode = empCode
%>
<%
set LVO = Server.CreateObject("ADODB.Recordset")
LVO.ActiveConnection = cn
if (isUC="Y") then
LVO.Source = "SELECT LVONUM,REGNUM, INVNUM, VENDORID,STATUS,SUBTOTAL, SYMBOL, INVDATE, DUEDATE, (SELECT LOCNAME=CASE WHEN LASTNAME IS NOT NULL THEN EMP.FIRSTNAME + ' '  + EMP.LASTNAME WHEN LASTNAME IS NULL THEN EMP.FIRSTNAME END FROM dbo.EMP WHERE EMP.EMPCODE=EXILVOHEADER.ROUTEUSER) AS LOCNAME,(SELECT TOP 1  VENDOR.NAME FROM VENDOR WHERE VENDOR.VENDORID=EXILVOHEADER.VENDORID) AS VENDORNAME, ISOPEN  FROM dbo.EXILVOHEADER  WHERE (STATUS = 'ROUTED' OR STATUS='APPROVED' OR STATUS='REJECTED') AND ( UCCODE='" + Replace(LVO__tmpCode, "'", "''") + "' OR ROUTEUSER='" + Replace(LVO__tmpCode, "'", "''") + "')"
else
LVO.Source = "SELECT LVONUM,REGNUM, INVNUM, VENDORID,STATUS,SUBTOTAL, SYMBOL, INVDATE, DUEDATE, (SELECT LOCNAME=CASE WHEN LASTNAME IS NOT NULL THEN EMP.FIRSTNAME + ' '  + EMP.LASTNAME WHEN LASTNAME IS NULL THEN EMP.FIRSTNAME END FROM dbo.EMP WHERE EMP.EMPCODE=EXILVOHEADER.ROUTEUSER) AS LOCNAME,(SELECT TOP 1  VENDOR.NAME FROM VENDOR WHERE VENDOR.VENDORID=EXILVOHEADER.VENDORID) AS VENDORNAME, ISOPEN  FROM dbo.EXILVOHEADER  WHERE STATUS = 'ROUTED'  AND ROUTEUSER='" + Replace(LVO__tmpCode, "'", "''") + "'"
end if
'LVO.CursorType = 0
'LVO.CursorLocation = 2
'LVO.LockType = 3
LVO.Open()
LVO_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
EXIREG_numRows = EXIREG_numRows + Repeat1__numRows
%>
<%
Dim Repeat2__numRows
Repeat2__numRows = -1
Dim Repeat2__index
Repeat2__index = 0
LVO_numRows = LVO_numRows + Repeat2__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

' set the record count
EXIREG_total = EXIREG.RecordCount

' set the number of rows displayed on this page
If (EXIREG_numRows < 0) Then
  EXIREG_numRows = EXIREG_total
Elseif (EXIREG_numRows = 0) Then
  EXIREG_numRows = 1
End If

' set the first and last displayed record
EXIREG_first = 1
EXIREG_last  = EXIREG_first + EXIREG_numRows - 1

' if we have the correct record count, check the other stats
If (EXIREG_total <> -1) Then
  If (EXIREG_first > EXIREG_total) Then EXIREG_first = EXIREG_total
  If (EXIREG_last > EXIREG_total) Then EXIREG_last = EXIREG_total
  If (EXIREG_numRows > EXIREG_total) Then EXIREG_numRows = EXIREG_total
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (EXIREG_total = -1) Then

  ' count the total records by iterating through the recordset
  EXIREG_total=0
  While (Not EXIREG.EOF)
    EXIREG_total = EXIREG_total + 1
    EXIREG.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (EXIREG.CursorType > 0) Then
    EXIREG.MoveFirst
  Else
    EXIREG.Requery
  End If

  ' set the number of rows displayed on this page
  If (EXIREG_numRows < 0 Or EXIREG_numRows > EXIREG_total) Then
    EXIREG_numRows = EXIREG_total
  End If

  ' set the first and last displayed record
  EXIREG_first = 1
  EXIREG_last = EXIREG_first + EXIREG_numRows - 1
  If (EXIREG_first > EXIREG_total) Then EXIREG_first = EXIREG_total
  If (EXIREG_last > EXIREG_total) Then EXIREG_last = EXIREG_total

End If
%>
<SCRIPT Language="JavaScript">

function DocLoad(){

}
function DoSort(dtsort,dtorder) {
//alert (link.id);
//location = link.href;
document.form1.dsort.value=dtsort;
document.form1.dorder.value=dtorder;
document.form1.submit();
return false;
}

function export_xls(){
window.open('My_Invoice_xls.asp?Dept=<%= Dept %>');
}
</SCRIPT>
<!-- #include file="pagetop_usr.asp" -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td nowrap height="21" bgcolor="#FFFFFF" width="3%" background="images/menu_end.gif">&nbsp;</td>
    <td nowrap height="21" bgcolor="#FFFFFF" width="28"> 
      <div align="center"><img src="images/menu_awal_on.gif" width="28" height="33"></div>    </td>
    <td width="15%" background="images/menuon.gif" height="21" nowrap> 
      <div align="center"><b><a href="My_invoice.asp" class="menu">My Invoice</a></b></div>    </td>
    <td height="21" bgcolor="#FFFFFF" width="28"><img src="images/menu_on_off_separator.gif" width="28" height="33"></td>
    <td height="21" bgcolor="#FFFFFF" width="15%" background="images/menuoff.gif"> 
      <div align="center"><a href="My_invoice_List.asp?InvStatus=0&RefOrder=0&CurSymbol=N" class="menu">My 
        Invoice Archive</a></div>    </td>
    <td height="21" bgcolor="#FFFFFF" width="11"><img src="images/Menu_offend.gif" width="11" height="33"></td>
    <td height="21" bgcolor="#FFFFFF" background="images/menu_end.gif"> 
<% if isManager = "Y" then %>      
	  <div align="right"><a href="Outstanding_Dept.asp" style="color:Red;font-weight:bold;">Outstanding Invoices</a>&nbsp;&nbsp;&nbsp;</div></td>
<% end if %>      
  </tr>
  <tr bgcolor="#93bee2"> 
    <td height="21" width="3%" bgcolor="#93bee2">&nbsp;</td>
    <td height="21" width="28" bgcolor="#93bee2">&nbsp;</td>
    <td width="10%" height="21" bgcolor="#93bee2">&nbsp;</td>
    <td height="21" width="28">&nbsp;</td>
    <td height="21">&nbsp;</td>
    <td height="21">&nbsp;</td>
    <td height="21">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#93bee2">
  <tr> 
    <td width="2%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td> 
      <form name="form1" method="post" action="My_invoice_xls.asp" target="_blank">
        &nbsp; 
        <input type="submit" name="Submit" value="Export To Excel" >
        <input type="hidden" name="InvNum" value="<%= request.querystring("InvNum") %>">
        <input type="hidden" name="InvStatus" value="0">
        <input type="hidden" name="RefOrder" value="0">
        <input type="hidden" name="VendorID" value="<%= request.querystring("VendorID") %>">
        <input type="hidden" name="CurSymbol" value="N">
        <input type="hidden" name="dsort" value="<%= Request.querystring("dsort") %>">
        <input type="hidden" name="dorder" value="<%= tmporder %>">
        &nbsp; 
        <input type="hidden" name="RecDate" value="<%= request.querystring("RecDate") %>">
        <input type="hidden" name="RecDate2" value="<%= request.querystring("RecDate2") %>">
        <input type="hidden" name="RptCond" value="<%= request.querystring("RptCond") %>">
      </form>
    </td>
  </tr>
  <tr> 
    <td width="2%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF"><img src="images/curv_data.gif" width="21" height="21"></td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr> 
    <td width="2%" height="25">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF" height="25">&nbsp;</td>
    <td bgcolor="#FFFFFF" height="25"><b>Invoices</b></td>
  </tr>
  <tr> 
    <td width="2%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#999999">
        <tr bgcolor="#D1DDEF" valign="middle"> 
          <td width="4%" height="25"> 
            <div align="center"><font color="#000000"><b>No.</b></font></div>          </td>
          <td width="7%" height="25" bgcolor="#D1DDEF"> 
            <div align="center"><font color="#000000"><b><a href="My_invoice.asp?dsort=REGNUM&amp;&amp;invnum=<%= tmpinvnum %>&amp;vendorid=<%= tmpvendorid %>&amp;recdate=<%= tmprecdate %>&amp;recdate2=<%= tmprecdate2 %>&amp;rptcond=<%= tmprptcond %>" class="menu">Reg. 
              No</a></b></font> 
              <% if (tmpSort="REGNUM") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
            </div>          </td>
          <td width="10%" height="25" bgcolor="#D1DDEF"> 
            <div align="center"><font color="#000000"><b>Invoice No.</b></font></div>          </td>
          <td width="9%" height="25" align="center"> <b>PO/SO/CO</b></td>
          <td width="9%" align="center">            <div align="center"><font color="#000066"><b><a href="My_invoice.asp?dsort=DEPARTMENT&amp;&amp;invnum=<%= tmpinvnum %>&amp;vendorid=<%= tmpvendorid %>&amp;recdate=<%= tmprecdate %>&amp;recdate2=<%= tmprecdate2 %>&amp;rptcond=<%= tmprptcond %>" class="menu">Dept</a> 
              <% if (tmpSort="DEPARTMENT") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font><font color="#000000"></font></div>         
			  </td>
          <td width="8%" height="25"> 
            <div align="center"><font color="#000000"><b>Due Date </b></font></div>          </td>
          <td width="4%" height="25"> 
            <div align="center"><font color="#000000"><b>Curr.</b></font></div>          </td>
          <td width="10%" height="25"> 
            <div align="center"><font color="#000066"><b><a href="My_invoice.asp?dsort=INVAMOUNT&amp;&amp;invnum=<%= tmpinvnum %>&amp;vendorid=<%= tmpvendorid %>&amp;recdate=<%= tmprecdate %>&amp;recdate2=<%= tmprecdate2 %>&amp;rptcond=<%= tmprptcond %>" class="menu">Amount</a> 
              <% if (tmpSort="INVAMOUNT") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font><font color="#000000"></font></div>          </td>
          <td height="25"> 
            <div align="center"><font color="#000000"><b><a href="My_invoice.asp?dsort=VENDORID&amp;&amp;invnum=<%= tmpinvnum %>&amp;vendorid=<%= tmpvendorid %>&amp;recdate=<%= tmprecdate %>&amp;recdate2=<%= tmprecdate2 %>&amp;rptcond=<%= tmprptcond %>" class="menu">Vendor</a></b></font><font color="#000066"><b> 
              <% if (tmpSort="VENDORID") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
              </b></font></div>          </td>
          <% if (isUC="Y") then %>
          <td width="6%" height="25"> 
            <div align="center"><b>Receipt</b></div>          </td>
          <% end if %>
          <td width="12%" height="25"> 
            <div align="center"><font color="#000000"><b><a href="My_invoice.asp?dsort=INVSTATUS&amp;&amp;invnum=<%= tmpinvnum %>&amp;vendorid=<%= tmpvendorid %>&amp;recdate=<%= tmprecdate %>&amp;recdate2=<%= tmprecdate2 %>&amp;rptcond=<%= tmprptcond %>" class="menu">Status</a></b></font><font color="#000066"><b>
			              <% if (tmpSort="INVSTATUS") then %>
              <img src="images/imgSort<%= tmpOrder %>.gif" width="10" height="15"> 
              <% end if %>
			  </b></font></div>          </td>
          <td width="12%" height="25" align="center"><b>Location</b></td>
        </tr>
        <% dim Incr
		   dim InvStatus
		   Incr = 1 %>
        <% 
While ((Repeat1__numRows <> 0) AND (NOT EXIREG.EOF)) 


%>
        <% if ((Incr mod 2 ) <> 0 ) Then %>
        <tr bgcolor="#FFFFFF"> 
          <td width="4%" height="21"> 
            <div align="right"><%= Incr %>.&nbsp;</div>          </td>
          <td width="7%" height="21"> 
            <div align="center"><b><a href="<% if( isManager = "Y") or (bDOA="Y") then %>My_InvApproval_mgr.asp<% else %>My_InvApproval.asp<% end if %>?seqnum=<%=(EXIREG.Fields.Item("SEQNUM").Value)%>"><%=(EXIREG.Fields.Item("REGNUM").Value)%></a></b></div>          </td>
          <td width="10%" height="21"><%=(EXIREG.Fields.Item("INVNUM").Value)%></td>
          <td width="9%" height="21"><%=(EXIREG.Fields.Item("PONUM").Value)%></td>
          <td width="9%"><div align="center"><%=(EXIREG.Fields.Item("DEPARTMENT").Value)%></div></td>
          <td width="8%" height="21"> 
            <div align="center"><%= DoDateTime((EXIREG.Fields.Item("INVDUEDATE").Value), 2, 2070) %></div>          </td>
          <td width="4%" height="21"> 
            <div align="center"><%=(EXIREG.Fields.Item("CURRENCYSYMBOL").Value)%></div>          </td>
          <td width="10%" height="21"> 
            <div align="right"><%= FormatNumber((EXIREG.Fields.Item("INVAMOUNT").Value), -1, -2, -2, -1) %></div>          </td>
          <td height="21"><%=(EXIREG.Fields.Item("VENDORNAME").Value)%></td>
          <% if (isUC="Y") then %>
          <td width="6%" height="21"> 
            <div align="center"> 
              <% if(EXIREG.Fields.Item("SERVICERCP").Value="Y") then %>
              <img src="images/check.jpg" width="18" height="17"> 
              <% else %>
              <img src="images/uncheck.jpg" width="14" height="14"> 
              <% end if %>
            </div>          </td>
          <% end if %>
          <td width="12%" height="21"> 
            <div align="center"><%=(EXIREG.Fields.Item("INVSTATUS").Value)%></div>          </td>
          <td width="12%" height="21"> 
            <% if (EXIREG("LOCATION")="FINANCE") then %>
            FINANCE 
            <% else %>
            <%= (EXIREG("LOCNAME")) %> 
            <% end if %>          </td>
        </tr>
        <% else %>
        <tr bgcolor="#eeeeee"> 
          <td width="4%" height="21"> 
            <div align="right"><%= Incr %>.&nbsp;</div>          </td>
          <td width="7%" height="21"> 
            <div align="center"><b><a href="<% if( isManager = "Y") or (bDOA="Y") then %>My_InvApproval_mgr.asp<% else %>My_InvApproval.asp<% end if %>?seqnum=<%=(EXIREG.Fields.Item("SEQNUM").Value)%>"><%=(EXIREG.Fields.Item("REGNUM").Value)%></a></b></div>          </td>
          <td width="10%" height="21"><%=(EXIREG.Fields.Item("INVNUM").Value)%></td>
          <td width="9%" height="21"><%=(EXIREG.Fields.Item("PONUM").Value)%></td>
          <td width="9%"><div align="center"><%=(EXIREG.Fields.Item("DEPARTMENT").Value)%></div></td>
          <td width="8%" height="21"> 
            <div align="center"><%= DoDateTime((EXIREG.Fields.Item("INVDUEDATE").Value), 2, 2070) %></div>          </td>
          <td width="4%" height="21"> 
            <div align="center"><%=(EXIREG.Fields.Item("CURRENCYSYMBOL").Value)%></div>          </td>
          <td width="10%" height="21"> 
            <div align="right"><%= FormatNumber((EXIREG.Fields.Item("INVAMOUNT").Value), -1, -2, -2, -1) %></div>          </td>
          <td height="21"><%=(EXIREG.Fields.Item("VENDORNAME").Value)%></td>
          <% if (isUC="Y") then %>
          <td width="6%" height="21"> 
            <div align="center"> 
              <% if(EXIREG.Fields.Item("SERVICERCP").Value="Y") then %>
              <img src="images/check.jpg" width="18" height="17"> 
              <% else %>
              <img src="images/uncheck.jpg" width="14" height="14"> 
              <% end if %>
            </div>          </td>
          <% end if %>
          <td width="12%" height="21"> 
            <div align="center"><%=(EXIREG.Fields.Item("INVSTATUS").Value)%></div>          </td>
          <td width="12%" height="21"> 
            <% if (EXIREG("LOCATION")="FINANCE") then %>
            FINANCE 
            <% else %>
            <%= (EXIREG("LOCNAME")) %> 
            <% end if %>          </td>
        </tr>
        <% end if %>
        <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Incr = Incr + 1
  EXIREG.MoveNext()
Wend
%>
      </table>
    </td>
  </tr>
  <tr> 
    <td width="2%" height="25">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF" height="25">&nbsp;</td>
    <td bgcolor="#FFFFFF" height="25">&nbsp;</td>
  </tr>
  <tr> 
    <td width="2%" height="25">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF" height="25">&nbsp;</td>
    <td bgcolor="#FFFFFF" height="25"><b>Low Value Order Invoices</b></td>
  </tr>
  <tr> 
    <td width="2%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#999999">
        <tr bgcolor="#D1DDEF" valign="middle"> 
          <td width="5%" height="25"> 
            <div align="center"><font color="#000000"><b>No.</b></font></div>
          </td>
          <td width="9%" height="25"> 
            <div align="center"><font color="#000000"><b>Reg. No </b></font></div>
          </td>
          <td width="10%" height="25"> 
            <div align="center"><font color="#000000"><b>Invoice No.</b></font></div>
          </td>
          <td width="9%" height="25"> 
            <div align="center"><font color="#000000"><b>LVO No.</b></font></div>
          </td>
          <td width="9%" height="25"> 
            <div align="center"><font color="#000000"><b>Recvd. Date </b></font></div>
          </td>
          <td width="4%" height="25"> 
            <div align="center"><font color="#000000"><b>Curr.</b></font></div>
          </td>
          <td width="10%" height="25"> 
            <div align="center"><font color="#000000"><b>Amount </b></font></div>
          </td>
          <td height="25"> 
            <div align="center"><font color="#000000"><b>Vendor</b></font></div>
          </td>
          <td width="15%" height="25" align="center"><b><font color="#000000">Location</font></b></td>
          <td width="8%" height="25"> 
            <div align="center"><font color="#000000"><b><b>Status</b></b></font></div>
          </td>
        </tr>
        <% dim j 
		j = 1 %>
        <% 
While ((Repeat2__numRows <> 0) AND (NOT LVO.EOF)) 
%>
        <% if ((j mod 2 ) <> 0 ) Then %>
        <tr bgcolor="#FFFFFF"> 
          <td width="5%"> 
            <div align="right"><%= j %>.&nbsp;</div>
          </td>
          <td> 
            <div align="center"><b><a href="My_invoiceLVO.asp?LVONum=<%=(LVO.Fields.Item("LVONUM").Value)%>"><%=(LVO.Fields.Item("REGNUM").Value)%></a></b></div>
          </td>
          <td width="10%"><%=(LVO.Fields.Item("INVNUM").Value)%></td>
          <td width="9%"> 
            <div align="center"><%=(LVO.Fields.Item("LVONUM").Value)%></div>
          </td>
          <td width="9%"> 
            <div align="center"><%= DoDateTime((LVO.Fields.Item("INVDATE").Value), 2, 2070) %></div>
          </td>
          <td width="4%"> 
            <div align="center"><%=(LVO.Fields.Item("SYMBOL").Value)%></div>
          </td>
          <td width="10%"> 
            <div align="right"><%= FormatNumber((LVO.Fields.Item("SUBTOTAL").Value), -1, -2, -2, -1) %></div>
          </td>
          <td><%=(LVO.Fields.Item("VENDORNAME").Value)%></td>
          <td width="15%"><%=(LVO.Fields.Item("LOCNAME").Value)%></td>
          <td> 
            <div align="center"><%=(LVO.Fields.Item("STATUS").Value)%></div>
          </td>
        </tr>
        <% else %>
        <tr bgcolor="#eeeeee"> 
          <td width="5%"> 
            <div align="right"><%= j %>.&nbsp;</div>
          </td>
          <td> 
            <div align="center"><b><a href="My_invoiceLVO.asp?LVONum=<%=(LVO.Fields.Item("LVONUM").Value)%>"><%=(LVO.Fields.Item("REGNUM").Value)%></a></b></div>
          </td>
          <td width="10%"><%=(LVO.Fields.Item("INVNUM").Value)%></td>
          <td width="9%"> 
            <div align="center"><%=(LVO.Fields.Item("LVONUM").Value)%></div>
          </td>
          <td width="9%"> 
            <div align="center"><%= DoDateTime((LVO.Fields.Item("INVDATE").Value), 2, 2070) %></div>
          </td>
          <td width="4%"> 
            <div align="center"><%=(LVO.Fields.Item("SYMBOL").Value)%></div>
          </td>
          <td width="10%"> 
            <div align="right"><%= FormatNumber((LVO.Fields.Item("SUBTOTAL").Value), -1, -2, -2, -1) %></div>
          </td>
          <td><%=(LVO.Fields.Item("VENDORNAME").Value)%></td>
          <td width="15%"><%=(LVO.Fields.Item("LOCNAME").Value)%></td>
          <td> 
            <div align="center"><%=(LVO.Fields.Item("STATUS").Value)%></div>
          </td>
        </tr>
        <% end if %>
        <% j = j +1
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  LVO.MoveNext()
Wend
%>
      </table>
    </td>
  </tr>
  <tr> 
    <td width="2%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<%
EXIREG.Close()
%>
<%
LVO.Close()
%>
